// components/textCover/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    srcUrl: String,
    text: String,
    operate: String,
    isStar: String
  },

  /**
   * 组件的初始数据
   */
  data: {
    iconColor: "#a9a9a9"
  },
  lifetimes: {
    attached: function() {
     
      if(this.properties.isStar == "true"){

        this.setData({
          iconColor:"#ffd700"
        })
      }
    },
   
  },
  /**
   * 组件的方法列表
   */
  methods: {
    
    star(e) {
      if (this.data.iconColor == "#a9a9a9") {
        
        this.setData({
          iconColor: "#ffd700"
        })
        this.triggerEvent('favour', );
      
        return
      }
      if (this.data.iconColor == "#ffd700") {
        this.setData({
          iconColor: "#a9a9a9"
        })
        this.triggerEvent('favour', );
      }
    },
    deleteFile() {
      this.triggerEvent('deleteFile', );
    }
  },

})